import time
import redis

from selenium.webdriver import ActionChains
from selenium.webdriver.chrome import webdriver


class TestUI:
    def __init__(self):
        self.driver = webdriver.Chrome()

    def testReg(self):
        self.driver.get('http://localhost:8080/reg')
        self.driver.find_element_by_name('username').send_keys('zs')
        time.sleep(2)
        self.driver.find_element_by_name('password').send_keys('134')
        self.driver.find_element_by_name('mobile').send_keys('1234567876543')
        action = ActionChains(self.driver)
        ball = self.driver.find_element_by_class_name('dv_handler')
        action.click_and_hold(ball).perform()
        action.move_by_offset('25220').perform()
        time.sleep(2)
        self.driver.find_element_by_class_name('van-button').click()

    def testLogin(self):
        pass


testui = TestUI()
testui.testReg()
